package com.gdqy.FCS.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;

import com.gdqy.FCS.dao.EnterpriseInfoDao;
import com.gdqy.FCS.entity.EnterpriseInfo;

@Controller
@Transactional
public class EnterpriseInfoService {
	@Autowired
	private EnterpriseInfoDao enterpriseInfoDao;
	
	public int insert(EnterpriseInfo enterpriseInfo){
		return enterpriseInfoDao.insert(enterpriseInfo);
	}
	
	//通过user_id查询企业信息
	public EnterpriseInfo selectByUser_id(int user_id){
		return enterpriseInfoDao.selectByUser_id(user_id);
	}
	
	//通过企业id查询企业信息
	public EnterpriseInfo selectById(int id){
		return enterpriseInfoDao.selectById(id);
	}
	
	//更新企业信息
	public int update(EnterpriseInfo enterpriseInfo){
		return enterpriseInfoDao.update(enterpriseInfo);
	}
	
	//根据企业经营范围查询企业
	public List<EnterpriseInfo> selectByRangeType_code(String type_code){
		return enterpriseInfoDao.selectByRangeType_code(type_code);
	}
	
	public int selectAllCount(){
		return enterpriseInfoDao.selectAllCount();
	}
}
